import 'package:flutterone/generated/json/base/json_convert_content.dart';
import 'package:flutterone/page/category/Model/json_info_entity.dart';

JsonInfoEntity $JsonInfoEntityFromJson(Map<String, dynamic> json) {
	final JsonInfoEntity jsonInfoEntity = JsonInfoEntity();
	final String? nickname = jsonConvert.convert<String>(json['nickname']);
	if (nickname != null) {
		jsonInfoEntity.nickname = nickname;
	}
	final int? level = jsonConvert.convert<int>(json['level']);
	if (level != null) {
		jsonInfoEntity.level = level;
	}
	final List<String>? courses = jsonConvert.convertListNotNull<String>(json['courses']);
	if (courses != null) {
		jsonInfoEntity.courses = courses;
	}
	final String? registerDate = jsonConvert.convert<String>(json['register_date']);
	if (registerDate != null) {
		jsonInfoEntity.registerDate = registerDate;
	}
	final JsonInfoComputer? computer = jsonConvert.convert<JsonInfoComputer>(json['computer']);
	if (computer != null) {
		jsonInfoEntity.computer = computer;
	}
	final String? imageName = jsonConvert.convert<String>(json['imageName']);
	if (nickname != null) {
		jsonInfoEntity.imageName = imageName;
	}
	return jsonInfoEntity;
}

Map<String, dynamic> $JsonInfoEntityToJson(JsonInfoEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['nickname'] = entity.nickname;
	data['level'] = entity.level;
	data['courses'] =  entity.courses;
	data['register_date'] = entity.registerDate;
	data['computer'] = entity.computer?.toJson();
	data['imageName'] =  entity.imageName;
	return data;
}

JsonInfoComputer $JsonInfoComputerFromJson(Map<String, dynamic> json) {
	final JsonInfoComputer jsonInfoComputer = JsonInfoComputer();
	final String? brand = jsonConvert.convert<String>(json['brand']);
	if (brand != null) {
		jsonInfoComputer.brand = brand;
	}
	final int? price = jsonConvert.convert<int>(json['price']);
	if (price != null) {
		jsonInfoComputer.price = price;
	}
	return jsonInfoComputer;
}

Map<String, dynamic> $JsonInfoComputerToJson(JsonInfoComputer entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['brand'] = entity.brand;
	data['price'] = entity.price;
	return data;
}